Integrand size = 40, antiderivative size = 154 \[ \int \cot ^5(c+d x) (a+b \tan (c+d x))^3 \left (B \tan (c+d x)+C \tan ^2(c+d x)\right ) \, dx=\left (a^3 B-3 a b^2 B-3 a^2 b C+b^3 C\right ) x+\frac {a \left (3 a^2 B-8 b^2 B-9 a b C\right ) \cot (c+d x)}{3 d}-\frac {a^2 (5 b B+3 a C) \cot ^2(c+d x)}{6 d}-\frac {\left (3 a^2 b B-b^3 B+a^3 C-3 a b^2 C\right ) \log (\sin (c+d x))}{d}-\frac {a B \cot ^3(c+d x) (a+b \tan (c+d x))^2}{3 d} \]
[Out]
Time = 0.51 (sec) , antiderivative size = 154, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.150, Rules used = {3713, 3686, 3716, 3709, 3612, 3556} \[ \int \cot ^5(c+d x) (a+b \tan (c+d x))^3 \left (B \tan (c+d x)+C \tan ^2(c+d x)\right ) \, dx=\frac {a \left (3 a^2 B-9 a b C-8 b^2 B\right ) \cot (c+d x)}{3 d}-\frac {a^2 (3 a C+5 b B) \cot ^2(c+d x)}{6 d}-\frac {\left (a^3 C+3 a^2 b B-3 a b^2 C-b^3 B\right ) \log (\sin (c+d x))}{d}+x \left (a^3 B-3 a^2 b C-3 a b^2 B+b^3 C\right )-\frac {a B \cot ^3(c+d x) (a+b \tan (c+d x))^2}{3 d} \]
[In]
[Out]
Rule 3556
Rule 3612
Rule 3686
Rule 3709
Rule 3713
Rule 3716
Rubi steps \begin{align*} \text {integral}& = \int \cot ^4(c+d x) (a+b \tan (c+d x))^3 (B+C \tan (c+d x)) \, dx \\ & = -\frac {a B \cot ^3(c+d x) (a+b \tan (c+d x))^2}{3 d}+\frac {1}{3} \int \cot ^3(c+d x) (a+b \tan (c+d x)) \left (a (5 b B+3 a C)-3 \left (a^2 B-b^2 B-2 a b C\right ) \tan (c+d x)-b (a B-3 b C) \tan ^2(c+d x)\right ) \, dx \\ & = -\frac {a^2 (5 b B+3 a C) \cot ^2(c+d x)}{6 d}-\frac {a B \cot ^3(c+d x) (a+b \tan (c+d x))^2}{3 d}+\frac {1}{3} \int \cot ^2(c+d x) \left (-a \left (3 a^2 B-8 b^2 B-9 a b C\right )-3 \left (3 a^2 b B-b^3 B+a^3 C-3 a b^2 C\right ) \tan (c+d x)-b^2 (a B-3 b C) \tan ^2(c+d x)\right ) \, dx \\ & = \frac {a \left (3 a^2 B-8 b^2 B-9 a b C\right ) \cot (c+d x)}{3 d}-\frac {a^2 (5 b B+3 a C) \cot ^2(c+d x)}{6 d}-\frac {a B \cot ^3(c+d x) (a+b \tan (c+d x))^2}{3 d}+\frac {1}{3} \int \cot (c+d x) \left (-3 \left (3 a^2 b B-b^3 B+a^3 C-3 a b^2 C\right )+3 \left (a^3 B-3 a b^2 B-3 a^2 b C+b^3 C\right ) \tan (c+d x)\right ) \, dx \\ & = \left (a^3 B-3 a b^2 B-3 a^2 b C+b^3 C\right ) x+\frac {a \left (3 a^2 B-8 b^2 B-9 a b C\right ) \cot (c+d x)}{3 d}-\frac {a^2 (5 b B+3 a C) \cot ^2(c+d x)}{6 d}-\frac {a B \cot ^3(c+d x) (a+b \tan (c+d x))^2}{3 d}+\left (-3 a^2 b B+b^3 B-a^3 C+3 a b^2 C\right ) \int \cot (c+d x) \, dx \\ & = \left (a^3 B-3 a b^2 B-3 a^2 b C+b^3 C\right ) x+\frac {a \left (3 a^2 B-8 b^2 B-9 a b C\right ) \cot (c+d x)}{3 d}-\frac {a^2 (5 b B+3 a C) \cot ^2(c+d x)}{6 d}-\frac {\left (3 a^2 b B-b^3 B+a^3 C-3 a b^2 C\right ) \log (\sin (c+d x))}{d}-\frac {a B \cot ^3(c+d x) (a+b \tan (c+d x))^2}{3 d} \\ \end{align*}
Result contains complex when optimal does not.
Time = 1.34 (sec) , antiderivative size = 164, normalized size of antiderivative = 1.06 \[ \int \cot ^5(c+d x) (a+b \tan (c+d x))^3 \left (B \tan (c+d x)+C \tan ^2(c+d x)\right ) \, dx=\frac {6 a \left (a^2 B-3 b^2 B-3 a b C\right ) \cot (c+d x)-3 a^2 (3 b B+a C) \cot ^2(c+d x)-2 a^3 B \cot ^3(c+d x)+3 (a+i b)^3 (-i B+C) \log (i-\tan (c+d x))-6 \left (3 a^2 b B-b^3 B+a^3 C-3 a b^2 C\right ) \log (\tan (c+d x))+3 (a-i b)^3 (i B+C) \log (i+\tan (c+d x))}{6 d} \]
[In]
[Out]
Time = 0.31 (sec) , antiderivative size = 172, normalized size of antiderivative = 1.12
method | result | size |
parallelrisch | \(\frac {3 \left (3 B \,a^{2} b -B \,b^{3}+C \,a^{3}-3 C a \,b^{2}\right ) \ln \left (\sec \left (d x +c \right )^{2}\right )+6 \left (-3 B \,a^{2} b +B \,b^{3}-C \,a^{3}+3 C a \,b^{2}\right ) \ln \left (\tan \left (d x +c \right )\right )-2 B \,a^{3} \cot \left (d x +c \right )^{3}+3 \left (-3 B \,a^{2} b -C \,a^{3}\right ) \cot \left (d x +c \right )^{2}+6 a \cot \left (d x +c \right ) \left (B \,a^{2}-3 B \,b^{2}-3 C a b \right )+6 d x \left (B \,a^{3}-3 B a \,b^{2}-3 C \,a^{2} b +C \,b^{3}\right )}{6 d}\) | \(172\) |
derivativedivides | \(\frac {\left (-3 B \,a^{2} b +B \,b^{3}-C \,a^{3}+3 C a \,b^{2}\right ) \ln \left (\tan \left (d x +c \right )\right )-\frac {B \,a^{3}}{3 \tan \left (d x +c \right )^{3}}-\frac {a^{2} \left (3 B b +C a \right )}{2 \tan \left (d x +c \right )^{2}}+\frac {a \left (B \,a^{2}-3 B \,b^{2}-3 C a b \right )}{\tan \left (d x +c \right )}+\frac {\left (3 B \,a^{2} b -B \,b^{3}+C \,a^{3}-3 C a \,b^{2}\right ) \ln \left (1+\tan \left (d x +c \right )^{2}\right )}{2}+\left (B \,a^{3}-3 B a \,b^{2}-3 C \,a^{2} b +C \,b^{3}\right ) \arctan \left (\tan \left (d x +c \right )\right )}{d}\) | \(174\) |
default | \(\frac {\left (-3 B \,a^{2} b +B \,b^{3}-C \,a^{3}+3 C a \,b^{2}\right ) \ln \left (\tan \left (d x +c \right )\right )-\frac {B \,a^{3}}{3 \tan \left (d x +c \right )^{3}}-\frac {a^{2} \left (3 B b +C a \right )}{2 \tan \left (d x +c \right )^{2}}+\frac {a \left (B \,a^{2}-3 B \,b^{2}-3 C a b \right )}{\tan \left (d x +c \right )}+\frac {\left (3 B \,a^{2} b -B \,b^{3}+C \,a^{3}-3 C a \,b^{2}\right ) \ln \left (1+\tan \left (d x +c \right )^{2}\right )}{2}+\left (B \,a^{3}-3 B a \,b^{2}-3 C \,a^{2} b +C \,b^{3}\right ) \arctan \left (\tan \left (d x +c \right )\right )}{d}\) | \(174\) |
norman | \(\frac {\left (B \,a^{3}-3 B a \,b^{2}-3 C \,a^{2} b +C \,b^{3}\right ) x \tan \left (d x +c \right )^{4}+\frac {a \left (B \,a^{2}-3 B \,b^{2}-3 C a b \right ) \tan \left (d x +c \right )^{3}}{d}-\frac {B \,a^{3} \tan \left (d x +c \right )}{3 d}-\frac {a^{2} \left (3 B b +C a \right ) \tan \left (d x +c \right )^{2}}{2 d}}{\tan \left (d x +c \right )^{4}}-\frac {\left (3 B \,a^{2} b -B \,b^{3}+C \,a^{3}-3 C a \,b^{2}\right ) \ln \left (\tan \left (d x +c \right )\right )}{d}+\frac {\left (3 B \,a^{2} b -B \,b^{3}+C \,a^{3}-3 C a \,b^{2}\right ) \ln \left (1+\tan \left (d x +c \right )^{2}\right )}{2 d}\) | \(196\) |
risch | \(B \,a^{3} x -3 B a \,b^{2} x -3 C \,a^{2} b x +C \,b^{3} x -\frac {6 i C a \,b^{2} c}{d}+\frac {6 i B \,a^{2} b c}{d}-i B \,b^{3} x +i C \,a^{3} x -\frac {2 i a \left (9 i B a b \,{\mathrm e}^{4 i \left (d x +c \right )}+3 i C \,a^{2} {\mathrm e}^{4 i \left (d x +c \right )}-6 B \,a^{2} {\mathrm e}^{4 i \left (d x +c \right )}+9 B \,b^{2} {\mathrm e}^{4 i \left (d x +c \right )}+9 C a b \,{\mathrm e}^{4 i \left (d x +c \right )}-9 i B a b \,{\mathrm e}^{2 i \left (d x +c \right )}-3 i C \,a^{2} {\mathrm e}^{2 i \left (d x +c \right )}+6 B \,a^{2} {\mathrm e}^{2 i \left (d x +c \right )}-18 B \,b^{2} {\mathrm e}^{2 i \left (d x +c \right )}-18 C a b \,{\mathrm e}^{2 i \left (d x +c \right )}-4 B \,a^{2}+9 B \,b^{2}+9 C a b \right )}{3 d \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )^{3}}-\frac {2 i B \,b^{3} c}{d}+\frac {2 i C \,a^{3} c}{d}-3 i C a \,b^{2} x +3 i B \,a^{2} b x -\frac {3 a^{2} \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right ) B b}{d}+\frac {\ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right ) B \,b^{3}}{d}-\frac {a^{3} \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right ) C}{d}+\frac {3 \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right ) C a \,b^{2}}{d}\) | \(383\) |
[In]
[Out]
none
Time = 0.25 (sec) , antiderivative size = 181, normalized size of antiderivative = 1.18 \[ \int \cot ^5(c+d x) (a+b \tan (c+d x))^3 \left (B \tan (c+d x)+C \tan ^2(c+d x)\right ) \, dx=-\frac {3 \, {\left (C a^{3} + 3 \, B a^{2} b - 3 \, C a b^{2} - B b^{3}\right )} \log \left (\frac {\tan \left (d x + c\right )^{2}}{\tan \left (d x + c\right )^{2} + 1}\right ) \tan \left (d x + c\right )^{3} + 2 \, B a^{3} + 3 \, {\left (C a^{3} + 3 \, B a^{2} b - 2 \, {\left (B a^{3} - 3 \, C a^{2} b - 3 \, B a b^{2} + C b^{3}\right )} d x\right )} \tan \left (d x + c\right )^{3} - 6 \, {\left (B a^{3} - 3 \, C a^{2} b - 3 \, B a b^{2}\right )} \tan \left (d x + c\right )^{2} + 3 \, {\left (C a^{3} + 3 \, B a^{2} b\right )} \tan \left (d x + c\right )}{6 \, d \tan \left (d x + c\right )^{3}} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 323 vs. \(2 (150) = 300\).
Time = 4.11 (sec) , antiderivative size = 323, normalized size of antiderivative = 2.10 \[ \int \cot ^5(c+d x) (a+b \tan (c+d x))^3 \left (B \tan (c+d x)+C \tan ^2(c+d x)\right ) \, dx=\begin {cases} \text {NaN} & \text {for}\: c = 0 \wedge d = 0 \\x \left (a + b \tan {\left (c \right )}\right )^{3} \left (B \tan {\left (c \right )} + C \tan ^{2}{\left (c \right )}\right ) \cot ^{5}{\left (c \right )} & \text {for}\: d = 0 \\\text {NaN} & \text {for}\: c = - d x \\B a^{3} x + \frac {B a^{3}}{d \tan {\left (c + d x \right )}} - \frac {B a^{3}}{3 d \tan ^{3}{\left (c + d x \right )}} + \frac {3 B a^{2} b \log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 d} - \frac {3 B a^{2} b \log {\left (\tan {\left (c + d x \right )} \right )}}{d} - \frac {3 B a^{2} b}{2 d \tan ^{2}{\left (c + d x \right )}} - 3 B a b^{2} x - \frac {3 B a b^{2}}{d \tan {\left (c + d x \right )}} - \frac {B b^{3} \log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 d} + \frac {B b^{3} \log {\left (\tan {\left (c + d x \right )} \right )}}{d} + \frac {C a^{3} \log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 d} - \frac {C a^{3} \log {\left (\tan {\left (c + d x \right )} \right )}}{d} - \frac {C a^{3}}{2 d \tan ^{2}{\left (c + d x \right )}} - 3 C a^{2} b x - \frac {3 C a^{2} b}{d \tan {\left (c + d x \right )}} - \frac {3 C a b^{2} \log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 d} + \frac {3 C a b^{2} \log {\left (\tan {\left (c + d x \right )} \right )}}{d} + C b^{3} x & \text {otherwise} \end {cases} \]
[In]
[Out]
none
Time = 0.34 (sec) , antiderivative size = 180, normalized size of antiderivative = 1.17 \[ \int \cot ^5(c+d x) (a+b \tan (c+d x))^3 \left (B \tan (c+d x)+C \tan ^2(c+d x)\right ) \, dx=\frac {6 \, {\left (B a^{3} - 3 \, C a^{2} b - 3 \, B a b^{2} + C b^{3}\right )} {\left (d x + c\right )} + 3 \, {\left (C a^{3} + 3 \, B a^{2} b - 3 \, C a b^{2} - B b^{3}\right )} \log \left (\tan \left (d x + c\right )^{2} + 1\right ) - 6 \, {\left (C a^{3} + 3 \, B a^{2} b - 3 \, C a b^{2} - B b^{3}\right )} \log \left (\tan \left (d x + c\right )\right ) - \frac {2 \, B a^{3} - 6 \, {\left (B a^{3} - 3 \, C a^{2} b - 3 \, B a b^{2}\right )} \tan \left (d x + c\right )^{2} + 3 \, {\left (C a^{3} + 3 \, B a^{2} b\right )} \tan \left (d x + c\right )}{\tan \left (d x + c\right )^{3}}}{6 \, d} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 390 vs. \(2 (148) = 296\).
Time = 1.43 (sec) , antiderivative size = 390, normalized size of antiderivative = 2.53 \[ \int \cot ^5(c+d x) (a+b \tan (c+d x))^3 \left (B \tan (c+d x)+C \tan ^2(c+d x)\right ) \, dx=\frac {B a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 3 \, C a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 9 \, B a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 15 \, B a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 36 \, C a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 36 \, B a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 24 \, {\left (B a^{3} - 3 \, C a^{2} b - 3 \, B a b^{2} + C b^{3}\right )} {\left (d x + c\right )} + 24 \, {\left (C a^{3} + 3 \, B a^{2} b - 3 \, C a b^{2} - B b^{3}\right )} \log \left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right ) - 24 \, {\left (C a^{3} + 3 \, B a^{2} b - 3 \, C a b^{2} - B b^{3}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}\right ) + \frac {44 \, C a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 132 \, B a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 132 \, C a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 44 \, B b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 15 \, B a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 36 \, C a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 36 \, B a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 3 \, C a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 9 \, B a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - B a^{3}}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3}}}{24 \, d} \]
[In]
[Out]
Time = 8.51 (sec) , antiderivative size = 169, normalized size of antiderivative = 1.10 \[ \int \cot ^5(c+d x) (a+b \tan (c+d x))^3 \left (B \tan (c+d x)+C \tan ^2(c+d x)\right ) \, dx=\frac {\ln \left (\mathrm {tan}\left (c+d\,x\right )\right )\,\left (-C\,a^3-3\,B\,a^2\,b+3\,C\,a\,b^2+B\,b^3\right )}{d}-\frac {{\mathrm {cot}\left (c+d\,x\right )}^3\,\left (\mathrm {tan}\left (c+d\,x\right )\,\left (\frac {C\,a^3}{2}+\frac {3\,B\,b\,a^2}{2}\right )+\frac {B\,a^3}{3}+{\mathrm {tan}\left (c+d\,x\right )}^2\,\left (-B\,a^3+3\,C\,a^2\,b+3\,B\,a\,b^2\right )\right )}{d}-\frac {\ln \left (\mathrm {tan}\left (c+d\,x\right )-\mathrm {i}\right )\,\left (B+C\,1{}\mathrm {i}\right )\,{\left (a+b\,1{}\mathrm {i}\right )}^3\,1{}\mathrm {i}}{2\,d}+\frac {\ln \left (\mathrm {tan}\left (c+d\,x\right )+1{}\mathrm {i}\right )\,\left (B-C\,1{}\mathrm {i}\right )\,{\left (a-b\,1{}\mathrm {i}\right )}^3\,1{}\mathrm {i}}{2\,d} \]
[In]
[Out]